package com.lmx;

import com.lmx.cache.CacheManager;
import com.lmx.cloud.FileUploadQueue;
import com.lmx.device.*;
import com.lmx.topic.TopicManager;
import com.lmx.upload.Client;
import com.lmx.bean.TopicInfo;
import com.lmx.control.WlanManager;
import com.lmx.util.ConfigUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import com.lmx.creceive.receive;
import java.io.*;


// 启动类
// 阅读方法：建议从init一步一步按ctrl进入看，会比较清楚
@SpringBootApplication
public class DeviceApplication extends SpringBootServletInitializer {
    public static void main(String[] args) throws IOException {
        SpringApplication.run(DeviceApplication.class, args);
        init();
        //new receive().canreceive();
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(this.getClass());
    }

    public static void init() throws IOException {
        // 启动文件队列的运行，就会自动从文件夹里读取文件，全部上传到Minio
        FileUploadQueue.start();
    }
}
